home *** CD-ROM | disk | FTP | other *** search
- on moveSlider scrollSprite, Tbutn, TSNum, topCovr, textHt
- global maxSteps, stepCounter, txtLocV, theTop, theBot
- setUpGlobals(scrollSprite, Tbutn, TSNum, topCovr, textHt)
- repeat while the stillDown
- set the locV of sprite Tbutn to the mouseV
- if the mouseV < theTop then
- set the locV of sprite Tbutn to theTop
- end if
- if the mouseV > theBot then
- set the locV of sprite Tbutn to theBot
- end if
- updateStage()
- set stepCounter to setTextSpriteLoc(Tbutn, TSNum, textHt)
- set the locV of sprite scrollSprite to txtLocV - (textHt * stepCounter)
- updateStage()
- end repeat
- end
-
- on setTextSpriteLoc Tbutn, TSNum, textH
- global maxSteps, stepCounter, theTop, theBot, theRange, totScroll, Steps
- set y1 to the locV of sprite Tbutn - the top of sprite TSNum - (the height of sprite value(Tbutn) / 2)
- set y3 to y1 * 1.0 / theRange
- set y6 to integer(maxSteps * y3)
- return y6
- end
-
- on scrollIt UpORDown, downCast, scrollSprite, Tbutn, TSNum, topCovr, textHt
- global maxSteps, stepCounter, txtLocV, theTop, theBot
- set me to the clickOn
- set upCastNum to the castNum of sprite me
- set the castNum of sprite me to downCast
- updateStage()
- set theHT to the height of sprite scrollSprite
- setUpGlobals(scrollSprite, Tbutn, TSNum, topCovr, textHt)
- repeat while the stillDown
- set yPos to the locV of sprite scrollSprite
- if UpORDown = "up" then
- set stepCounter to stepCounter - 1
- if stepCounter < 0 then
- set stepCounter to 0
- end if
- else
- if UpORDown = "down" then
- set stepCounter to stepCounter + 1
- if stepCounter > maxSteps then
- set stepCounter to maxSteps
- end if
- end if
- end if
- set the locV of sprite scrollSprite to txtLocV - (textHt * stepCounter)
- updateStage()
- set theVloc to setBtnSpriteLoc(stepCounter, TSNum, Tbutn)
- set the locV of sprite Tbutn to theVloc
- updateStage()
- end repeat
- set the castNum of sprite me to upCastNum
- updateStage()
- end
-
- on setUpGlobals scrollSprite, Tbutn, TSNum, topCovr, textHt
- global maxSteps, theTop, theBot, theRange, totScroll, Steps
- set totScroll to the height of sprite value(scrollSprite)
- set dispHt to the height of sprite value(TSNum) + (2 * (the bottom of sprite topCovr - the top of sprite value(TSNum)))
- set totScroll to totScroll - dispHt
- set maxSteps to totScroll / textHt
- set HBtnHt to the height of sprite value(Tbutn) / 2
- set TStop to the top of sprite value(TSNum)
- set TSbot to the bottom of sprite value(TSNum)
- set theTop to TStop + HBtnHt + 1
- set theBot to TSbot - HBtnHt
- set theRange to the height of sprite value(TSNum) - (2 * HBtnHt)
- end
-
- on setBtnSpriteLoc stepCounter, TSNum, Tbutn
- global maxSteps, theTop, theBot, theRange, totScroll, Steps
- set y3 to stepCounter * 1.0 / maxSteps
- set y5 to integer(y3 * theRange)
- set y6 to the top of sprite TSNum + y5 + (the height of sprite value(Tbutn) / 2)
- return y6
- end
-